<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>社交资讯平台</title>
    <!-- 引入Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- 引入Font Awesome图标 -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css">
    <style>
        /* 顶部导航栏样式 */
        .navbar-top {
            background-color: #fff;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
            position: sticky;
            top: 0;
            z-index: 1030;
        }
        
        /* 品牌标识样式 */
        .navbar-brand {
            font-weight: 700;
            font-size: 1.5rem;
            color: #165DFF;
            display: flex;
            align-items: center;
        }
        
        .brand-icon {
            width: 36px;
            height: 36px;
            background-color: #165DFF;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 10px;
            color: white;
        }
        
        /* 导航链接样式 */
        .nav-link {
            color: #333;
            margin: 0 8px;
            font-weight: 500;
            transition: color 0.2s;
        }
        
        .nav-link:hover, .nav-link.active {
            color: #165DFF;
        }
        
        /* 搜索框样式 */
        .search-input {
            border-radius: 20px 0 0 20px;
            border-right: none;
        }
        
        .search-btn {
            border-radius: 0 20px 20px 0;
            background-color: #165DFF;
            border-color: #165DFF;
        }
        
        /* 通知图标样式 */
        .notification-icon {
            position: relative;
            font-size: 1.2rem;
            color: #333;
            cursor: pointer;
        }
        
        .notification-badge {
            position: absolute;
            top: -5px;
            right: -5px;
            width: 18px;
            height: 18px;
            background-color: #ff4d4f;
            color: white;
            border-radius: 50%;
            font-size: 0.7rem;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        /* 下拉菜单样式 */
        .dropdown-menu {
            border-radius: 8px;
            box-shadow: 0 4px 16px rgba(0,0,0,0.1);
            border: none;
        }
        
        .dropdown-item {
            padding: 8px 16px;
            transition: background-color 0.2s;
        }
        
        .dropdown-item:hover {
            background-color: #f5f7fa;
            color: #165DFF;
        }
        
        /* 发布按钮样式 */
        .publish-btn {
            background-color: #165DFF;
            border-color: #165DFF;
            border-radius: 20px;
            padding: 6px 18px;
            font-weight: 500;
        }
        
        .publish-btn:hover {
            background-color: #0E42D2;
            border-color: #0E42D2;
        }
        
        /* 二级导航栏样式 */
        .subnav {
            background-color: #f5f7fa;
            border-top: 1px solid #eee;
        }
        
        .subnav-link {
            color: #666;
            padding: 10px 16px;
            font-size: 0.9rem;
            text-decoration: none;
            display: inline-block;
        }
        
        .subnav-link:hover, .subnav-link.active {
            color: #165DFF;
            border-bottom: 2px solid #165DFF;
        }
        
        /* 响应式调整 */
        @media (max-width: 991px) {
            .search-container {
                margin: 10px 0;
            }
            
            .navbar-nav {
                align-items: center;
            }
            
            .nav-item {
                margin: 5px 0;
            }
            
            .subnav {
                overflow-x: auto;
                white-space: nowrap;
            }
        }
    </style>
</head>
<body>
    <!-- 顶部导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-light navbar-top py-3">
        <div class="container">
            <!-- 品牌标识 -->
            <a class="navbar-brand" href="#">
                <div class="brand-icon">
                    <i class="fa fa-connectdevelop"></i>
                </div>
                社交资讯
            </a>
            
            <!-- 移动端汉堡菜单 -->
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" 
                    data-bs-target="#mainNav" aria-controls="mainNav" 
                    aria-expanded="false" aria-label="切换导航">
                <span class="navbar-toggler-icon"></span>
            </button>
            
            <!-- 导航内容 -->
            <div class="collapse navbar-collapse" id="mainNav">
                <!-- 主导航菜单 -->
                <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                    <li class="nav-item">
                        <a class="nav-link active" aria-current="page" href="#">首页</a>
                    </li>
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" role="button" 
                           data-bs-toggle="dropdown" aria-expanded="false">
                            内容
                        </a>
                        <ul class="dropdown-menu">
                            <li><a class="dropdown-item" href="#"><i class="fa fa-file-text-o me-2"></i>文章</a></li>
                            <li><a class="dropdown-item" href="#"><i class="fa fa-comment-o me-2"></i>问答</a></li>
                            <li><a class="dropdown-item" href="#"><i class="fa fa-newspaper-o me-2"></i>动态</a></li>
                            <li><a class="dropdown-item" href="#"><i class="fa fa-bookmark-o me-2"></i>专题</a></li>
                        </ul>
                    </li>
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" role="button" 
                           data-bs-toggle="dropdown" aria-expanded="false">
                            互动
                        </a>
                        <ul class="dropdown-menu">
                            <li><a class="dropdown-item" href="#"><i class="fa fa-calendar-o me-2"></i>活动</a></li>
                            <li><a class="dropdown-item" href="#"><i class="fa fa-heart-o me-2"></i>约会</a></li>
                            <li><a class="dropdown-item" href="#"><i class="fa fa-bar-chart-o me-2"></i>投票</a></li>
                        </ul>
                    </li>
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" role="button" 
                           data-bs-toggle="dropdown" aria-expanded="false">
                            服务
                        </a>
                        <ul class="dropdown-menu">
                            <li><a class="dropdown-item" href="#"><i class="fa fa-shopping-bag me-2"></i>商品</a></li>
                            <li><a class="dropdown-item" href="#"><i class="fa fa-handshake-o me-2"></i>服务</a></li>
                            <li><a class="dropdown-item" href="#"><i class="fa fa-exchange me-2"></i>供需合作</a></li>
                        </ul>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#"><i class="fa fa-star-o me-1"></i>星座</a>
                    </li>
                </ul>
                
                <!-- 搜索框 -->
                <div class="d-flex search-container flex-1 max-w-md mx-3">
                    <input type="search" class="form-control search-input" 
                           placeholder="搜索文章、问答、用户..." aria-label="Search">
                    <button class="btn search-btn" type="submit">
                        <i class="fa fa-search"></i>
                    </button>
                </div>
                
                <!-- 用户功能区 -->
                <div class="d-flex align-items-center">
                    <!-- 发布按钮 -->
                    <button class="btn publish-btn me-3 d-none d-lg-block" type="button">
                        <i class="fa fa-plus me-1"></i> 发布
                    </button>
                    
                    <!-- 通知图标 -->
                    <div class="notification-icon me-3">
                        <i class="fa fa-bell-o"></i>
                        <span class="notification-badge">5</span>
                    </div>
                    
                    <!-- 用户头像 -->
                    <div class="dropdown">
                        <a href="#" class="d-flex align-items-center" role="button" 
                           data-bs-toggle="dropdown" aria-expanded="false">
                            <img src="https://picsum.photos/id/1005/40/40" alt="用户头像" 
                                 class="rounded-circle" style="width: 36px; height: 36px;">
                        </a>
                        <ul class="dropdown-menu dropdown-menu-end">
                            <li><a class="dropdown-item" href="#"><i class="fa fa-user-o me-2"></i>个人中心</a></li>
                            <li><a class="dropdown-item" href="#"><i class="fa fa-cog me-2"></i>设置</a></li>
                            <li><hr class="dropdown-divider"></li>
                            <li><a class="dropdown-item text-danger" href="#"><i class="fa fa-sign-out me-2"></i>退出登录</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </nav>
    
    <!-- 二级导航栏（栏目展示） -->
    <div class="subnav">
        <div class="container">
            <a href="#" class="subnav-link active">推荐</a>
            <a href="#" class="subnav-link">热点</a>
            <a href="#" class="subnav-link">科技</a>
            <a href="#" class="subnav-link">娱乐</a>
            <a href="#" class="subnav-link">财经</a>
            <a href="#" class="subnav-link">体育</a>
            <a href="#" class="subnav-link">职场</a>
            <a href="#" class="subnav-link">情感</a>
            <a href="#" class="subnav-link">健康</a>
            <a href="#" class="subnav-link">美食</a>
            <a href="#" class="subnav-link">旅行</a>
            <a href="#" class="subnav-link">更多 <i class="fa fa-angle-right"></i></a>
        </div>
    </div>

    <!-- 引入Bootstrap 5 JS -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        // 滚动时改变导航栏样式
        window.addEventListener('scroll', function() {
            const navbar = document.querySelector('.navbar-top');
            if (window.scrollY > 10) {
                navbar.classList.add('shadow');
            } else {
                navbar.classList.remove('shadow');
            }
        });
    </script>
</body>
</html>

